package com.itheima.service;

import com.alibaba.dubbo.config.annotation.Service;
import com.itheima.dao.MemberDao;
import com.itheima.pojo.Member;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import redis.clients.jedis.JedisPool;
import service.LoginService;

@Transactional
@Service(interfaceClass=LoginService.class)
public class LoginServiceImpl implements LoginService {

    @Autowired
    private JedisPool jedisPool;
    @Autowired
    private MemberDao memberDao;

    //验证码输入正确
    //判断当前用户是否为会员
    @Override
    public Member findByPhone(String telephone) {


        return memberDao.findByPhone(telephone);
    }


    //当前用户不是会员，自动完成注册
    @Override
    public void save(Member member) {
        memberDao.save(member);
    }

}
